define(['text!service/instructions.html','../service/data/appliancesList'],
	function(viewTemplate, Appliances) {
		return Piece.View.extend({
			id: 'service_instructions',
			events: {
				"click .csair-btn-lite": "submit1",
				"click #right": "right",
				"click .list-st li" : "view",
			},
			render: function() {
				$(this.el).html(viewTemplate);
				Piece.View.prototype.render.call(this);
				return this;
			},
			onShow: function() {
				var windowHeight = $(window).height();
				var elTop = $("#instructions").offset().top;
				var elHeight = windowHeight - elTop ;

				console.info(elHeight);
				$("#instructions").css({
					"height": elHeight
				});
				new iScroll($("#instructions")[0]);
				this.TempviewlateRender(Appliances);
			},
			//模板页面渲染
			TempviewlateRender: function(data) {

				var listTemplateWiki = _.template($("#appliancesTemp").html(), {
					"rows": data.rows
				});

				$("#appliancesList").append(listTemplateWiki);


				// new iScroll($("#standards"));
			},
			submit1: function() {


				this.container.navigateForResult('/service/instructionsList', {
					trigger: true
				}, 'service/instructions', this.onGotResult);


			},
			view: function(){
				this.container.navigateForResult('/service/instructionsList',{
					trigger:true
				},'service/instructions', this.onGotResult);
			}
		}); //view define

	});